<template>
  <div>
    <div>减法组件{{ count }} {{ stname }}</div>
    <button @click="sub">-1</button>
    <button @click="sub2(10)">-10</button>
    <button @click="testajax">天气</button>
  </div>
</template>

<script>
import {mapState,mapMutations,mapActions} from 'vuex'

export default {
  computed: {
    ...mapState('m_cart',['count','stname'])
  },
  methods:{
    ...mapActions('m_cart',['testajax']),
    ...mapMutations('m_cart',['sub','sub2'])
  }
}
</script>

<style>

</style>